package com.company.cloud.crm.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.crm.modules.api.request.CustomerNumStatisticsRequest;
import com.company.cloud.crm.modules.api.response.CustomerNumStatisticsResponse;
import org.springframework.stereotype.Component;

import com.company.cloud.crm.modules.api.request.Contact2UserAddRequest;
import com.company.cloud.crm.modules.api.response.Contact2UserAddResponse;
import com.company.cloud.crm.modules.api.service.CrmRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class CrmRemoteServiceFallbackFactory implements FallbackFactory<CrmRemoteService>{
	
	@Override
	public CrmRemoteService create(Throwable cause) {
		return new CrmRemoteService() {
			@Override
			public BaseClientResult<Contact2UserAddResponse> addContact2User(Contact2UserAddRequest params) {
				return BaseClientResult.callbackError();
			}
			@Override
			public BaseClientResult<CustomerNumStatisticsResponse> customerNumStatistics(CustomerNumStatisticsRequest params) {
				return BaseClientResult.callbackError();
			}
		};
	}

}
